**REStat paper "Breastfeeding and Children's Early Cognitive Outcomes."

/* PSID DATA CENTER *****************************************************
   JOBID            : 126511                            
   DATA_DOMAIN      : PSID                              
   USER_WHERE       : NULL                              
   FILE_TYPE        : NULL                              
   OUTPUT_DATA_TYPE : ASCII                             
   STATEMENTS       : SAS Statements                    
   CODEBOOK_TYPE    : HTML                              
   N_OF_VARIABLES   : 242                               
   N_OF_OBSERVATIONS: 22155                             
   MAX_REC_LENGTH   : 383                               
   DATE & TIME      : May 26, 2011 @ 12:23:33
************************************************************************/
libname dd 'X:\Donnanew';

FILENAME pfam08 "X:\Donnanew\pfam08.txt" ;

DATA x;
   ATTRIB
      V8802    FORMAT=F4.   LABEL="1983 INTERVIEW NUMBER"                   
      V9357    FORMAT=F1.   LABEL="M37 RECORD RELIG PREF?HD"                
      V9358    FORMAT=F1.   LABEL="M38-39 RELIGIOUS PREF-HD"                
      V9381    FORMAT=F1.   LABEL="REGION OF 1983 INTERVIEW"                
      V9408    FORMAT=F1.   LABEL="RACE (FROM 1972)"                        
      V10002   FORMAT=F4.   LABEL="1984 INTERVIEW NUMBER"                   
      V11004   FORMAT=F1.   LABEL="M37 RECORD RELIG PREF?HD"                
      V11005   FORMAT=F1.   LABEL="M38-39 RELIGIOUS PREF-HD"                
      V11028   FORMAT=F4.   LABEL="REGION OF 1984 INTERVIEW"                
      V11055   FORMAT=F1.   LABEL="RACE (FROM 1972)"                        
      V11102   FORMAT=F4.   LABEL="1985 INTERVIEW NUMBER"                   
      V11937   FORMAT=F1.   LABEL="G31 SPANISH DESCENT-HEAD"                
      V11938   FORMAT=F1.   LABEL="G32 RACE OF HEAD (1 MEN)"                
      V11939   FORMAT=F1.   LABEL="G32 RACE OF HEAD (2 MEN)"                
      V11981   FORMAT=F2.   LABEL="G57-58 RELIGIOUS PREF"                   
      V12292   FORMAT=F1.   LABEL="N31 SPANISH DESCENT-WIFE"                
      V12293   FORMAT=F1.   LABEL="N32 RACE OF WIFE (1 MEN)"                
      V12294   FORMAT=F1.   LABEL="N32 RACE OF WIFE (2 MEN)"                
      V12336   FORMAT=F2.   LABEL="N57-58 RELIGIOUS PREF"                   
      V12379   FORMAT=F1.   LABEL="REGION OF 1985 INTERVIEW"                
      V12502   FORMAT=F4.   LABEL="1986 INTERVIEW NUMBER"                   
      V13499   FORMAT=F1.   LABEL="K18 SPANISH DESCENT   WF"                
      V13500   FORMAT=F1.   LABEL="K19 RACE OF WIFE 1"                      
      V13501   FORMAT=F1.   LABEL="K19 RACE OF WIFE 2"                      
      V13530   FORMAT=F2.   LABEL="K42-43 RELIGIOUS PREF  W"                
      V13564   FORMAT=F1.   LABEL="L31 SPANISH DESCENT   HD"                
      V13565   FORMAT=F1.   LABEL="L32 RACE OF HEAD 1"                      
      V13566   FORMAT=F1.   LABEL="L32 RACE OF HEAD 2"                      
      V13604   FORMAT=F2.   LABEL="L55-56 RELIGIOUS PREF  H"                
      V13631   FORMAT=F1.   LABEL="REGION OF 1986 INTERVIEW"                
      V13702   FORMAT=F4.   LABEL="1987 INTERVIEW NUMBER"                   
      V14546   FORMAT=F1.   LABEL="K18 SPANISH DESCENT   WF"                
      V14547   FORMAT=F1.   LABEL="K19 RACE OF WIFE 1"                      
      V14548   FORMAT=F1.   LABEL="K19 RACE OF WIFE 2"                      
      V14577   FORMAT=F2.   LABEL="K42-43 RELIGIOUS PREF  W"                
      V14611   FORMAT=F1.   LABEL="L31 SPANISH DESCENT   HD"                
      V14612   FORMAT=F1.   LABEL="L32 RACE OF HEAD 1"                      
      V14613   FORMAT=F1.   LABEL="L32 RACE OF HEAD 2"                      
      V14651   FORMAT=F2.   LABEL="L55-56 RELIGIOUS PREF  H"                
      V14678   FORMAT=F1.   LABEL="REGION OF 1987 INTERVIEW"                
      V14802   FORMAT=F4.   LABEL="1988 INTERVIEW NUMBER"                   
      V16020   FORMAT=F1.   LABEL="K18 SPANISH DESCENT   WF"                
      V16021   FORMAT=F1.   LABEL="K19 RACE OF WIFE 1"                      
      V16022   FORMAT=F1.   LABEL="K19 RACE OF WIFE 2"                      
      V16051   FORMAT=F2.   LABEL="K42-43 RELIGIOUS PREF  W"                
      V16085   FORMAT=F1.   LABEL="L31 SPANISH DESCENT   HD"                
      V16086   FORMAT=F1.   LABEL="L32 RACE OF HEAD 1"                      
      V16087   FORMAT=F1.   LABEL="L32 RACE OF HEAD 2"                      
      V16125   FORMAT=F2.   LABEL="L55-56 RELIGIOUS PREF  H"                
      V16152   FORMAT=F1.   LABEL="REGION OF 1988 INTERVIEW"                
      V16302   FORMAT=F4.   LABEL="1989 INTERVIEW NUMBER"                   
      V17417   FORMAT=F1.   LABEL="K18 SPANISH DESCENT   WF"                
      V17418   FORMAT=F1.   LABEL="K19 RACE OF WIFE 1"                      
      V17419   FORMAT=F1.   LABEL="K19 RACE OF WIFE 2"                      
      V17448   FORMAT=F2.   LABEL="K42-43 RELIGIOUS PREF  W"                
      V17482   FORMAT=F1.   LABEL="L31 SPANISH DESCENT   HD"                
      V17483   FORMAT=F1.   LABEL="L32 RACE OF HEAD 1"                      
      V17484   FORMAT=F1.   LABEL="L32 RACE OF HEAD 2"                      
      V17522   FORMAT=F2.   LABEL="L55-56 RELIGIOUS PREF  H"                
      V17538   FORMAT=F1.   LABEL="REGION OF 1989 INTERVIEW"                
      V17702   FORMAT=F5.   LABEL="1990 INTERVIEW NUMBER 90"                
      V18748   FORMAT=F1.   LABEL="L18 SPANISH DESCENT   WF"                
      V18749   FORMAT=F1.   LABEL="L19 RACE OF WIFE 1"                      
      V18750   FORMAT=F1.   LABEL="L19 RACE OF WIFE 2"                      
      V18779   FORMAT=F2.   LABEL="L42-43 RELIGIOUS PREF  W"                
      V18813   FORMAT=F1.   LABEL="M31 SPANISH DESCENT   HD"                
      V18814   FORMAT=F1.   LABEL="M32 RACE OF HEAD 1"                      
      V18815   FORMAT=F1.   LABEL="M32 RACE OF HEAD 2"                      
      V18853   FORMAT=F2.   LABEL="M55-56 RELIGIOUS PREF  H"                
      V18889   FORMAT=F1.   LABEL="REGION OF 1990 INTERVIEW"                
      V19002   FORMAT=F4.   LABEL="1991 INTERVIEW NUMBER"                   
      V20048   FORMAT=F1.   LABEL="K18 SPANISH DESCENT   WF"                
      V20049   FORMAT=F1.   LABEL="K19 RACE OF WIFE 1"                      
      V20050   FORMAT=F1.   LABEL="K19 RACE OF WIFE 2"                      
      V20079   FORMAT=F2.   LABEL="K42-43 RELIGIOUS PREF  W"                
      V20113   FORMAT=F1.   LABEL="L31 SPANISH DESCENT   HD"                
      V20114   FORMAT=F1.   LABEL="L32 RACE OF HEAD 1"                      
      V20115   FORMAT=F1.   LABEL="L32 RACE OF HEAD 2"                      
      V20153   FORMAT=F2.   LABEL="L55-56 RELIGIOUS PREF  H"                
      V20189   FORMAT=F1.   LABEL="REGION OF 1991 INTERVIEW"                
      V20302   FORMAT=F4.   LABEL="1992 INTERVIEW NUMBER"                   
      V21354   FORMAT=F1.   LABEL="L18 SPANISH DESCENT   WF"                
      V21355   FORMAT=F1.   LABEL="L19 RACE OF WIFE 1"                      
      V21356   FORMAT=F1.   LABEL="L19 RACE OF WIFE 2"                      
      V21385   FORMAT=F2.   LABEL="L42-43 RELIGIOUS PREF  W"                
      V21419   FORMAT=F1.   LABEL="M31 SPANISH DESCENT   HD"                
      V21420   FORMAT=F1.   LABEL="M32 RACE OF HEAD 1"                      
      V21421   FORMAT=F1.   LABEL="M32 RACE OF HEAD 2"                      
      V21459   FORMAT=F2.   LABEL="M55-56 RELIGIOUS PREF  H"                
      V21495   FORMAT=F1.   LABEL="REGION OF 1992 INTERVIEW"                
      V21602   FORMAT=F5.   LABEL="1993 INTERVIEW NUMBER"                   
      V23211   FORMAT=F1.   LABEL="K18 WTR WF OF SPANISH DESCENT"           
      V23212   FORMAT=F1.   LABEL="K19 RACE OF WF-1ST MENTION"              
      V23213   FORMAT=F1.   LABEL="K19 RACE OF WF-2ND MENTION"              
      V23242   FORMAT=F2.   LABEL="K42-43 WF RELIGIOUS PREFERENCE"          
      V23275   FORMAT=F1.   LABEL="L31 WTR HD OF SPANISH DESCENT"           
      V23276   FORMAT=F1.   LABEL="L32 RACE OF HD-1ST MENTION"              
      V23277   FORMAT=F1.   LABEL="L32 RACE OF HD-2ND MENTION"              
      V23315   FORMAT=F2.   LABEL="L55-56 HD RELIGIOUS PREFERENCE"          
      V23327   FORMAT=F1.   LABEL="REGION OF 1993 INTERVIEW"                
      ER2002   FORMAT=F5.   LABEL="1994 INTERVIEW #"                        
      ER3880   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 1 WF"                
      ER3881   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 2 WF"                
      ER3882   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 3 WF"                
      ER3883   FORMAT=F1.   LABEL="K19 RACE OF WIFE      1"                 
      ER3884   FORMAT=F1.   LABEL="K19 RACE OF WIFE      2"                 
      ER3885   FORMAT=F1.   LABEL="K19 RACE OF WIFE      3"                 
      ER3913   FORMAT=F2.   LABEL="K42 RELIGIOUS PREF WF"                   
      ER3914   FORMAT=F2.   LABEL="K43 RELIG DEMOMINTN WF"                  
      ER3941   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 1 HD"                
      ER3942   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 2 HD"                
      ER3943   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 3 HD"                
      ER3944   FORMAT=F1.   LABEL="L32 RACE OF HEAD      1"                 
      ER3945   FORMAT=F1.   LABEL="L32 RACE OF HEAD      2"                 
      ER3946   FORMAT=F1.   LABEL="L32 RACE OF HEAD      3"                 
      ER3983   FORMAT=F2.   LABEL="L55 RELIGIOUS PREF HD"                   
      ER3984   FORMAT=F2.   LABEL="L56 RELIG DEMONINTN HD"                  
      ER4156   FORMAT=F2.   LABEL="PSID STATE OF RESIDENCE CODE"            
      ER4157   FORMAT=F2.   LABEL="CURRENT STATE"                           
      ER5002   FORMAT=F5.   LABEL="1995 INTERVIEW #"                        
      ER6750   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 1 WF"                
      ER6751   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 2 WF"                
      ER6752   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 3 WF"                
      ER6753   FORMAT=F1.   LABEL="K19 RACE OF WIFE      1"                 
      ER6754   FORMAT=F1.   LABEL="K19 RACE OF WIFE      2"                 
      ER6755   FORMAT=F1.   LABEL="K19 RACE OF WIFE      3"                 
      ER6783   FORMAT=F2.   LABEL="K42 RELIGIOUS PREF WF"                   
      ER6784   FORMAT=F2.   LABEL="K43 RELIG DEMOMINTN WF"                  
      ER6811   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 1 HD"                
      ER6812   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 2 HD"                
      ER6813   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 3 HD"                
      ER6814   FORMAT=F1.   LABEL="L32 RACE OF HEAD      1"                 
      ER6815   FORMAT=F1.   LABEL="L32 RACE OF HEAD      2"                 
      ER6816   FORMAT=F1.   LABEL="L32 RACE OF HEAD      3"                 
      ER6853   FORMAT=F2.   LABEL="L55 RELIGIOUS PREF HD"                   
      ER6854   FORMAT=F2.   LABEL="L56 RELIG DEMONINTN HD"                  
      ER6996   FORMAT=F2.   LABEL="PSID STATE OF RESIDENCE CODE"            
      ER6997   FORMAT=F2.   LABEL="CURRENT STATE"                           
      ER7002   FORMAT=F4.   LABEL="1996 INTERVIEW #"                        
      ER8996   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 1 WF"                
      ER8997   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 2 WF"                
      ER8998   FORMAT=F1.   LABEL="K18 SPANISH DESCENT 3 WF"                
      ER8999   FORMAT=F1.   LABEL="K19 RACE OF WIFE      1"                 
      ER9000   FORMAT=F1.   LABEL="K19 RACE OF WIFE      2"                 
      ER9001   FORMAT=F1.   LABEL="K19 RACE OF WIFE      3"                 
      ER9029   FORMAT=F2.   LABEL="K42 RELIGIOUS PREF WF"                   
      ER9030   FORMAT=F2.   LABEL="K43 RELIG DEMOMINTN WF"                  
      ER9057   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 1 HD"                
      ER9058   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 2 HD"                
      ER9059   FORMAT=F1.   LABEL="L31 SPANISH DESCENT 3 HD"                
      ER9060   FORMAT=F1.   LABEL="L32 RACE OF HEAD      1"                 
      ER9061   FORMAT=F1.   LABEL="L32 RACE OF HEAD      2"                 
      ER9062   FORMAT=F1.   LABEL="L32 RACE OF HEAD      3"                 
      ER9099   FORMAT=F2.   LABEL="L55 RELIGIOUS PREF HD"                   
      ER9100   FORMAT=F2.   LABEL="L56 RELIG DEMONINTN HD"                  
      ER9247   FORMAT=F2.   LABEL="PSID STATE OF RESIDENCE CODE"            
      ER9248   FORMAT=F2.   LABEL="CURRENT STATE"                           
      ER10002  FORMAT=F5.   LABEL="1997 INTERVIEW #"                        
      ER10004  FORMAT=F2.   LABEL="CURRENT STATE"                           
      ER11760  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 1"                   
      ER11761  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 2"                   
      ER11762  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 3"                   
      ER11763  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 4"                   
      ER11807  FORMAT=F2.   LABEL="K61 RELIGIOUS PREF-WF"                   
      ER11808  FORMAT=F2.   LABEL="K62 RELIG DENOMINTN-WF"                  
      ER11848  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 1"                   
      ER11849  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 2"                   
      ER11850  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 3"                   
      ER11851  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 4"                   
      ER11895  FORMAT=F2.   LABEL="L68 RELIGIOUS PREF-HD"                   
      ER11896  FORMAT=F2.   LABEL="L69 RELIG DENOMINTN-HD"                  
      ER12079  FORMAT=F9.2  LABEL="TOTAL FAMILY INCOME"                     
      ER13002  FORMAT=F5.   LABEL="1999 FAMILY INTERVIEW (ID) NUMBER"       
      ER15836  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 1"                   
      ER15837  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 2"                   
      ER15838  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 3"                   
      ER15839  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 4"                   
      ER15884  FORMAT=F2.   LABEL="K61 RELIGIOUS PREF-WF"                   
      ER15885  FORMAT=F2.   LABEL="K62 RELIG DENOMINTN-WF"                  
      ER15928  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 1"                   
      ER15929  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 2"                   
      ER15930  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 3"                   
      ER15931  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 4"                   
      ER15977  FORMAT=F2.   LABEL="L68 RELIGIOUS PREF-HD"                   
      ER15978  FORMAT=F2.   LABEL="L69 RELIG DENOMINTN-HD"                  
      ER17002  FORMAT=F4.   LABEL="2001 FAMILY INTERVIEW (ID) NUMBER"       
      ER19897  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 1"                   
      ER19898  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 2"                   
      ER19899  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 3"                   
      ER19900  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 4"                   
      ER19945  FORMAT=F2.   LABEL="K61 RELIGIOUS PREF-WF"                   
      ER19946  FORMAT=F2.   LABEL="K62 RELIG DENOMINTN-WF"                  
      ER19989  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 1"                   
      ER19990  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 2"                   
      ER19991  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 3"                   
      ER19992  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 4"                   
      ER20038  FORMAT=F2.   LABEL="L68 RELIGIOUS PREF-HD"                   
      ER20039  FORMAT=F2.   LABEL="L69 RELIG DENOMINTN-HD"                  
      ER21002  FORMAT=F5.   LABEL="2003 FAMILY INTERVIEW (ID) NUMBER"       
      ER23334  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 1"                   
      ER23335  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 2"                   
      ER23336  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 3"                   
      ER23337  FORMAT=F1.   LABEL="K34/87 RACE OF WIFE 4"                   
      ER23382  FORMAT=F2.   LABEL="K61 RELIGIOUS PREF-WF"                   
      ER23383  FORMAT=F2.   LABEL="K62 RELIG DENOMINTN-WF"                  
      ER23426  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 1"                   
      ER23427  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 2"                   
      ER23428  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 3"                   
      ER23429  FORMAT=F1.   LABEL="L40/95 RACE OF HEAD 4"                   
      ER23474  FORMAT=F2.   LABEL="L68 RELIGIOUS PREF-HD"                   
      ER23475  FORMAT=F2.   LABEL="L69 RELIG DENOMINTN-HD"                  
      ER25002  FORMAT=F5.   LABEL="2005 FAMILY INTERVIEW (ID) NUMBER"       
      ER27296  FORMAT=F1.   LABEL="K33A SPANISH DESCENT-WIFE"               
      ER27297  FORMAT=F1.   LABEL="K34 RACE OF WIFE-MENTION 1"              
      ER27298  FORMAT=F1.   LABEL="K34 RACE OF WIFE-MENTION 2"              
      ER27299  FORMAT=F1.   LABEL="K34 RACE OF WIFE-MENTION 3"              
      ER27300  FORMAT=F1.   LABEL="K34 RACE OF WIFE-MENTION 4"              
      ER27346  FORMAT=F2.   LABEL="K61 RELIGIOUS PREFERENCE-WF"             
      ER27347  FORMAT=F2.   LABEL="K62 RELIG DENOMINATION-WF"               
      ER27392  FORMAT=F1.   LABEL="L39A SPANISH DESCENT-HEAD"               
      ER27393  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 1"              
      ER27394  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 2"              
      ER27395  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 3"              
      ER27396  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 4"              
      ER27442  FORMAT=F2.   LABEL="L68 RELIGIOUS PREFERENCE-HD"             
      ER27443  FORMAT=F2.   LABEL="L69 RELIG DENOMINATION-HD"               
      ER36002  FORMAT=F5.   LABEL="2007 FAMILY INTERVIEW (ID) NUMBER"       
      ER37721  FORMAT=F1.   LABEL="W130 HOW IMPORTANT LV ESTATE TO REL ORG" 
      ER40471  FORMAT=F1.   LABEL="K39 SPANISH DESCENT-WIFE"                
      ER40472  FORMAT=F1.   LABEL="K40 RACE OF WIFE-MENTION 1"              
      ER40473  FORMAT=F1.   LABEL="K40 RACE OF WIFE-MENTION 2"              
      ER40474  FORMAT=F1.   LABEL="K40 RACE OF WIFE-MENTION 3"              
      ER40475  FORMAT=F1.   LABEL="K40 RACE OF WIFE-MENTION 4"              
      ER40521  FORMAT=F2.   LABEL="K68 RELIGIOUS PREFERENCE-WF"             
      ER40522  FORMAT=F2.   LABEL="K69 RELIG DENOMINATION-WF"               
      ER40564  FORMAT=F1.   LABEL="L39 SPANISH DESCENT-HEAD"                
      ER40565  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 1"              
      ER40566  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 2"              
      ER40567  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 3"              
      ER40568  FORMAT=F1.   LABEL="L40 RACE OF HEAD-MENTION 4"              
      ER40614  FORMAT=F2.   LABEL="L68 RELIGIOUS PREFERENCE-HD"             
      ER40615  FORMAT=F2.   LABEL="L69 RELIG DENOMINATION-HD"               
   ;
   INFILE pfam08 LRECL = 383 ; 
   INPUT 
      V8802        1 - 4     V9357        5 - 5     V9358        6 - 6    
      V9381        7 - 7     V9408        8 - 8     V10002       9 - 12   
      V11004      13 - 13    V11005      14 - 14    V11028      15 - 18   
      V11055      19 - 19    V11102      20 - 23    V11937      24 - 24   
      V11938      25 - 25    V11939      26 - 26    V11981      27 - 28   
      V12292      29 - 29    V12293      30 - 30    V12294      31 - 31   
      V12336      32 - 33    V12379      34 - 34    V12502      35 - 38   
      V13499      39 - 39    V13500      40 - 40    V13501      41 - 41   
      V13530      42 - 43    V13564      44 - 44    V13565      45 - 45   
      V13566      46 - 46    V13604      47 - 48    V13631      49 - 49   
      V13702      50 - 53    V14546      54 - 54    V14547      55 - 55   
      V14548      56 - 56    V14577      57 - 58    V14611      59 - 59   
      V14612      60 - 60    V14613      61 - 61    V14651      62 - 63   
      V14678      64 - 64    V14802      65 - 68    V16020      69 - 69   
      V16021      70 - 70    V16022      71 - 71    V16051      72 - 73   
      V16085      74 - 74    V16086      75 - 75    V16087      76 - 76   
      V16125      77 - 78    V16152      79 - 79    V16302      80 - 83   
      V17417      84 - 84    V17418      85 - 85    V17419      86 - 86   
      V17448      87 - 88    V17482      89 - 89    V17483      90 - 90   
      V17484      91 - 91    V17522      92 - 93    V17538      94 - 94   
      V17702      95 - 99    V18748     100 - 100   V18749     101 - 101  
      V18750     102 - 102   V18779     103 - 104   V18813     105 - 105  
      V18814     106 - 106   V18815     107 - 107   V18853     108 - 109  
      V18889     110 - 110   V19002     111 - 114   V20048     115 - 115  
      V20049     116 - 116   V20050     117 - 117   V20079     118 - 119  
      V20113     120 - 120   V20114     121 - 121   V20115     122 - 122  
      V20153     123 - 124   V20189     125 - 125   V20302     126 - 129  
      V21354     130 - 130   V21355     131 - 131   V21356     132 - 132  
      V21385     133 - 134   V21419     135 - 135   V21420     136 - 136  
      V21421     137 - 137   V21459     138 - 139   V21495     140 - 140  
      V21602     141 - 145   V23211     146 - 146   V23212     147 - 147  
      V23213     148 - 148   V23242     149 - 150   V23275     151 - 151  
      V23276     152 - 152   V23277     153 - 153   V23315     154 - 155  
      V23327     156 - 156   ER2002     157 - 161   ER3880     162 - 162  
      ER3881     163 - 163   ER3882     164 - 164   ER3883     165 - 165  
      ER3884     166 - 166   ER3885     167 - 167   ER3913     168 - 169  
      ER3914     170 - 171   ER3941     172 - 172   ER3942     173 - 173  
      ER3943     174 - 174   ER3944     175 - 175   ER3945     176 - 176  
      ER3946     177 - 177   ER3983     178 - 179   ER3984     180 - 181  
      ER4156     182 - 183   ER4157     184 - 185   ER5002     186 - 190  
      ER6750     191 - 191   ER6751     192 - 192   ER6752     193 - 193  
      ER6753     194 - 194   ER6754     195 - 195   ER6755     196 - 196  
      ER6783     197 - 198   ER6784     199 - 200   ER6811     201 - 201  
      ER6812     202 - 202   ER6813     203 - 203   ER6814     204 - 204  
      ER6815     205 - 205   ER6816     206 - 206   ER6853     207 - 208  
      ER6854     209 - 210   ER6996     211 - 212   ER6997     213 - 214  
      ER7002     215 - 218   ER8996     219 - 219   ER8997     220 - 220  
      ER8998     221 - 221   ER8999     222 - 222   ER9000     223 - 223  
      ER9001     224 - 224   ER9029     225 - 226   ER9030     227 - 228  
      ER9057     229 - 229   ER9058     230 - 230   ER9059     231 - 231  
      ER9060     232 - 232   ER9061     233 - 233   ER9062     234 - 234  
      ER9099     235 - 236   ER9100     237 - 238   ER9247     239 - 240  
      ER9248     241 - 242   ER10002    243 - 247   ER10004    248 - 249  
      ER11760    250 - 250   ER11761    251 - 251   ER11762    252 - 252  
      ER11763    253 - 253   ER11807    254 - 255   ER11808    256 - 257  
      ER11848    258 - 258   ER11849    259 - 259   ER11850    260 - 260  
      ER11851    261 - 261   ER11895    262 - 263   ER11896    264 - 265  
      ER12079    266 - 274   ER13002    275 - 279   ER15836    280 - 280  
      ER15837    281 - 281   ER15838    282 - 282   ER15839    283 - 283  
      ER15884    284 - 285   ER15885    286 - 287   ER15928    288 - 288  
      ER15929    289 - 289   ER15930    290 - 290   ER15931    291 - 291  
      ER15977    292 - 293   ER15978    294 - 295   ER17002    296 - 299  
      ER19897    300 - 300   ER19898    301 - 301   ER19899    302 - 302  
      ER19900    303 - 303   ER19945    304 - 305   ER19946    306 - 307  
      ER19989    308 - 308   ER19990    309 - 309   ER19991    310 - 310  
      ER19992    311 - 311   ER20038    312 - 313   ER20039    314 - 315  
      ER21002    316 - 320   ER23334    321 - 321   ER23335    322 - 322  
      ER23336    323 - 323   ER23337    324 - 324   ER23382    325 - 326  
      ER23383    327 - 328   ER23426    329 - 329   ER23427    330 - 330  
      ER23428    331 - 331   ER23429    332 - 332   ER23474    333 - 334  
      ER23475    335 - 336   ER25002    337 - 341   ER27296    342 - 342  
      ER27297    343 - 343   ER27298    344 - 344   ER27299    345 - 345  
      ER27300    346 - 346   ER27346    347 - 348   ER27347    349 - 350  
      ER27392    351 - 351   ER27393    352 - 352   ER27394    353 - 353  
      ER27395    354 - 354   ER27396    355 - 355   ER27442    356 - 357  
      ER27443    358 - 359   ER36002    360 - 364   ER37721    365 - 365  
      ER40471    366 - 366   ER40472    367 - 367   ER40473    368 - 368  
      ER40474    369 - 369   ER40475    370 - 370   ER40521    371 - 372  
      ER40522    373 - 374   ER40564    375 - 375   ER40565    376 - 376  
      ER40566    377 - 377   ER40567    378 - 378   ER40568    379 - 379  
      ER40614    380 - 381   ER40615    382 - 383  
   ;

data dd.pfam08;
set x;
keep intnum00-intnum99 regne00-regne99 regnc00-regnc99 regs00-regs99 regw00-regw99
black83 hisp83 black84 hisp84 hblack00-hblack99 wblack00-wblack99 hhisp00-hhisp99 
whisp00-whisp99 faminc97 ;

**Let's start coding up things by year;  

**1983;
intnum83 = .;
intnum83 = v8802;

regne83 = .;
if V9381 = 1 then regne83 = 1;
regnc83 = .;
if V9381 = 2 then regnc83 = 1;
regs83 = .;
if V9381 = 3 then regs83 = 1;
regw83 = .;
if (V9381 = 4 or v9381 = 5) then regw83 = 1;

*note, this is race of 'family' from 1972 data;
black83 = .;
if (v9408 = 2) then black83 = 1;
if (v9408 = 1 or v9408 = 3 or v9408 = 7) then black83 = 0;
hisp83 = .;
if (v9408 = 3) then hisp83 = 1;
if (v9408 = 1 or v9408 = 2 or v9408 = 7) then hisp83 = 0;

**1984;
intnum84 = .;
intnum84 = v10002;

regne84 = .;
if V11028 = 1 then regne84 = 1;
regnc84 = .;
if V11028 = 2 then regnc84 = 1;
regs84 = .;
if V11028 = 3 then regs84 = 1;
regw84 = .;
if (V11028 = 4 or v11028 = 5) then regw84 = 1;

*note, this is race of 'family' from 1972 data;
black84 = .;
if (v11055 = 2) then black84 = 1;
if (v11055 = 1 or v11055 = 3 or v11055 = 7) then black84 = 0;
hisp84 = .;
if (v11055 = 3) then hisp84 = 1;
if (v11055 = 1 or v11055 = 2 or v11055 = 7) then hisp84 = 0;

**1985;
intnum85 = .;
intnum85 = v11102;

**now, separate for wife or for head;
hblack85 = .;
hhisp85 = .;
if (v11937 ge 1 and v11937 le 7) then hhisp85 = 1;
if (v11938 = 2 or v11939 = 2) then hblack85 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp85 = 1 then hblack85 = 0;
if hblack85 = 1 then hhisp85 = 0;
if (hhisp85 = .) then do;
   if (v11938 = 1 or v11938 = 3 or v11938 = 4 or v11938 = 7
    or v11939 = 1 or v11939 = 3 or v11939 = 4 or v11939 = 7) then hhisp85 = 0; 
end;
if (hblack85 = .) then do;
   if (v11938 = 1 or v11938 = 3 or v11938 = 4 or v11938 = 7
    or v11939 = 1 or v11939 = 3 or v11939 = 4 or v11939 = 7) then hblack85 = 0; 
end;

wblack85 = .;
whisp85 = .;
if (v12292 ge 1 and v12292 le 7) then whisp85 = 1;
if (v12293 = 2 or v12294 = 2) then wblack85 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp85 = 1 then wblack85 = 0;
if wblack85 = 1 then whisp85 = 0;
if (whisp85 = .) then do;
   if (v12292 = 1 or v12292 = 3 or v12292 = 4 or v12292 = 7
    or v12293 = 1 or v12293 = 3 or v12293 = 4 or v12293 = 7) then whisp85 = 0; 
end;
if (wblack85 = .) then do;
   if (v12292 = 1 or v12292 = 3 or v12292 = 4 or v12292 = 7
    or v12293 = 1 or v12293 = 3 or v12293 = 4 or v12293 = 7) then wblack85 = 0; 
end;

regne85 = .;
if V12379 = 1 then regne85 = 1;
regnc85 = .;
if V12379 = 2 then regnc85 = 1;
regs85 = .;
if V12379 = 3 then regs85 = 1;
regw85 = .;
if (V12379 = 4 or v12379 = 5) then regw85 = 1;

**1986;
intnum86 = .;
intnum86 = v12502;

hblack86 = .;
hhisp86 = .;
if (v13564 ge 1 and v13564 le 7) then hhisp86 = 1;
if (v13565 = 2 or v13566 = 2) then hblack86 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp86 = 1 then hblack86 = 0;
if hblack86 = 1 then hhisp86 = 0;
if (hhisp86 = .) then do;
   if (v13565 = 1 or v13565 = 3 or v13565 = 4 or v13565 = 7
    or v13566 = 1 or v13566 = 3 or v13566 = 4 or v13566 = 7) then hhisp86 = 0; 
end;
if (hblack86 = .) then do;
   if (v13565 = 1 or v13565 = 3 or v13565 = 4 or v13565 = 7
    or v13566 = 1 or v13566 = 3 or v13566 = 4 or v13566 = 7) then hblack86 = 0; 
end;

wblack86 = .;
whisp86 = .;
if (v13499 ge 1 and v13499 le 7) then whisp86 = 1;
if (v13500 = 2 or v13501 = 2) then wblack86 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp86 = 1 then wblack86 = 0;
if wblack86 = 1 then whisp86 = 0;
if (whisp86 = .) then do;
   if (v13500 = 1 or v13500 = 3 or v13500 = 4 or v13500 = 7
    or v13501 = 1 or v13501 = 3 or v13501 = 4 or v13501 = 7) then whisp86 = 0; 
end;
if (wblack86 = .) then do;
   if (v13500 = 1 or v13500 = 3 or v13500 = 4 or v13500 = 7
    or v13501 = 1 or v13501 = 3 or v13501 = 4 or v13501 = 7) then wblack86 = 0; 
end;

regne86 = .;
if V13631 = 1 then regne86 = 1;
regnc86 = .;
if V13631 = 2 then regnc86 = 1;
regs86 = .;
if V13631 = 3 then regs86 = 1;
regw86 = .;
if (V13631 = 4 or v13631 = 5) then regw86 = 1;

**1987;
intnum87 = .;
intnum87 = v13702;

hblack87 = .;
hhisp87 = .;
if (v14611 ge 1 and v14611 le 7) then hhisp87 = 1;
if (v14612 = 2 or v14613 = 2) then hblack87 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp87 = 1 then hblack87 = 0;
if hblack87 = 1 then hhisp87 = 0;
if (hhisp87 = .) then do;
   if (v14612 = 1 or v14612 = 3 or v14612 = 4 or v14612 = 7
    or v14613 = 1 or v14613 = 3 or v14613 = 4 or v14613 = 7) then hhisp87 = 0; 
end;
if (hblack87 = .) then do;
   if (v14612 = 1 or v14612 = 3 or v14612 = 4 or v14612 = 7
    or v14613 = 1 or v14613 = 3 or v14613 = 4 or v14613 = 7) then hblack87 = 0; 
end;

wblack87 = .;
whisp87 = .;
if (v14546 ge 1 and v14546 le 7) then whisp87 = 1;
if (v14547 = 2 or v14548 = 2) then wblack87 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp87 = 1 then wblack87 = 0;
if wblack87 = 1 then whisp87 = 0;
if (whisp87 = .) then do;
   if (v14547 = 1 or v14547 = 3 or v14547 = 4 or v14547 = 7
    or v14548 = 1 or v14548 = 3 or v14548 = 4 or v14548 = 7) then whisp87 = 0; 
end;
if (wblack87 = .) then do;
   if (v14547 = 1 or v14547 = 3 or v14547 = 4 or v14547 = 7
    or v14548 = 1 or v14548 = 3 or v14548 = 4 or v14548 = 7) then wblack87 = 0; 
end;

regne87 = .;
if V14678 = 1 then regne87 = 1;
regnc87 = .;
if V14678 = 2 then regnc87 = 1;
regs87 = .;
if V14678 = 3 then regs87 = 1;
regw87 = .;
if (V14678 = 4 or v14678 = 5) then regw87 = 1;

**1988;
intnum88 = .;
intnum88 = v14802;

hblack88 = .;
hhisp88 = .;
if (v16085 ge 1 and v16085 le 7) then hhisp88 = 1;
if (v16086 = 2 or v16087 = 2) then hblack88 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp88 = 1 then hblack88 = 0;
if hblack88 = 1 then hhisp88 = 0;
if (hhisp88 = .) then do;
   if (v16086 = 1 or v16086 = 3 or v16086 = 4 or v16086 = 7
    or v16087 = 1 or v16087 = 3 or v16087 = 4 or v16087 = 7) then hhisp88 = 0; 
end;
if (hblack88 = .) then do;
   if (v16086 = 1 or v16086 = 3 or v16086 = 4 or v16086 = 7
    or v16087 = 1 or v16087 = 3 or v16087 = 4 or v16087 = 7) then hblack88 = 0; 
end;

wblack88 = .;
whisp88 = .;
if (v16020 ge 1 and v16020 le 7) then whisp88 = 1;
if (v16021 = 2 or v16022 = 2) then wblack88 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp88 = 1 then wblack88 = 0;
if wblack88 = 1 then whisp88 = 0;
if (whisp88 = .) then do;
   if (v16021 = 1 or v16021 = 3 or v16021 = 4 or v16021 = 7
    or v16022 = 1 or v16022 = 3 or v16022 = 4 or v16022 = 7) then whisp88 = 0; 
end;
if (wblack88 = .) then do;
   if (v16021 = 1 or v16021 = 3 or v16021 = 4 or v16021 = 7
    or v16022 = 1 or v16022 = 3 or v16022 = 4 or v16022 = 7) then wblack88 = 0; 
end;

regne88 = .;
if V16152 = 1 then regne88 = 1;
regnc88 = .;
if V16152 = 2 then regnc88 = 1;
regs88 = .;
if V16152 = 3 then regs88 = 1;
regw88 = .;
if (V16152 = 4 or v16152 = 5) then regw88 = 1;

**1989;
intnum89 = .;
intnum89 = v16302;

hblack89 = .;
hhisp89 = .;
if (v17482 ge 1 and v17482 le 7) then hhisp89 = 1;
if (v17483 = 2 or v17483 = 2) then hblack89 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp89 = 1 then hblack89 = 0;
if hblack89 = 1 then hhisp89 = 0;
if (hhisp89 = .) then do;
   if (v17482 = 1 or v17482 = 3 or v17482 = 4 or v17482 = 7
    or v17483 = 1 or v17483 = 3 or v17483 = 4 or v17483 = 7) then hhisp89 = 0; 
end;
if (hblack89 = .) then do;
   if (v17482 = 1 or v17482 = 3 or v17482 = 4 or v17482 = 7
    or v17483 = 1 or v17483 = 3 or v17483 = 4 or v17483 = 7) then hblack89 = 0; 
end;

wblack89 = .;
whisp89 = .;
if (v17417 ge 1 and v17417 le 7) then whisp89 = 1;
if (v17418 = 2 or v17419 = 2) then wblack89 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp89 = 1 then wblack89 = 0;
if wblack89 = 1 then whisp89 = 0;
if (whisp89 = .) then do;
   if (v17418 = 1 or v17418 = 3 or v17418 = 4 or v17418 = 7
    or v17419 = 1 or v17419 = 3 or v17419 = 4 or v17419 = 7) then whisp89 = 0; 
end;
if (wblack89 = .) then do;
   if (v17418 = 1 or v17418 = 3 or v17418 = 4 or v17418 = 7
    or v17419 = 1 or v17419 = 3 or v17419 = 4 or v17419 = 7) then wblack89 = 0; 
end;

regne89 = .;
if V17538 = 1 then regne89 = 1;
regnc89 = .;
if V17538 = 2 then regnc89 = 1;
regs89 = .;
if V17538 = 3 then regs89 = 1;
regw89 = .;
if (V17538 = 4 or v17538 = 5) then regw89 = 1;

**1990;
intnum90 = .;
intnum90 = v17702;

hblack90 = .;
hhisp90 = .;
if (v18813 ge 1 and v18813 le 7) then hhisp90 = 1;
if (v18814 = 5 or v18815 = 5) then hhisp90 = 1;
if (v18814 = 2 or v18815 = 2) then hblack90 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp90 = 1 then hblack90 = 0;
if hblack90 = 1 then hhisp90 = 0;
if (hhisp90 = .) then do;
   if (v18814 = 1 or v18814 = 3 or v18814 = 4 or v18814 = 7 or v18814 = 6
    or v18815 = 1 or v18815 = 3 or v18815 = 4 or v18815 = 7 or v18815 = 6) then hhisp90 = 0; 
end;
if (hblack90 = .) then do;
   if (v18814 = 1 or v18814 = 3 or v18814 = 4 or v18814 = 7 or v18814 = 6
    or v18815 = 1 or v18815 = 3 or v18815 = 4 or v18815 = 7 or v18815 = 6) then hblack90 = 0; 
end;

wblack90 = .;
whisp90 = .;
if (v18748 ge 1 and v18748 le 7) then whisp90 = 1;
if (v18749 = 5 or v18750 = 5) then whisp90 = 1;
if (v18749 = 2 or v18750 = 2) then wblack90 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp90 = 1 then wblack90 = 0;
if wblack90 = 1 then whisp90 = 0;
if (whisp90 = .) then do;
   if (v18749 = 1 or v18749 = 3 or v18749 = 4 or v18749 = 7 or v18749 = 6
    or v18750 = 1 or v18750 = 3 or v18750 = 4 or v18750 = 7 or v18750 = 6) then whisp90 = 0; 
end;
if (wblack90 = .) then do;
   if (v18749 = 1 or v18749 = 3 or v18749 = 4 or v18749 = 7 or v18749 = 6
    or v18750 = 1 or v18750 = 3 or v18750 = 4 or v18750 = 7 or v18750 = 6) then wblack90 = 0; 
end;

regne90 = .;
if V18889 = 1 then regne90 = 1;
regnc90 = .;
if V18889 = 2 then regnc90 = 1;
regs90 = .;
if V18889 = 3 then regs90 = 1;
regw90 = .;
if (V18889 = 4 or v18889 = 5) then regw90 = 1;

**1991;
intnum91 = .;
intnum91 = v19002;

hblack91 = .;
hhisp91 = .;
if (v20113 ge 1 and v20113 le 7) then hhisp91 = 1;
if (v20114 = 5 or v20115 = 5) then hhisp91 = 1;
if (v20114 = 2 or v20115 = 2) then hblack91 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp91 = 1 then hblack91 = 0;
if hblack91 = 1 then hhisp91 = 0;
if (hhisp91 = .) then do;
   if (v20114 = 1 or v20114 = 3 or v20114 = 4 or v20114 = 7 or v20114 = 6
    or v20115 = 1 or v20115 = 3 or v20115 = 4 or v20115 = 7 or v20115 = 6) then hhisp91 = 0; 
end;
if (hblack91 = .) then do;
   if (v20114 = 1 or v20114 = 3 or v20114 = 4 or v20114 = 7 or v20114 = 6
    or v20115 = 1 or v20115 = 3 or v20115 = 4 or v20115 = 7 or v20115 = 6) then hblack91 = 0; 
end;

wblack91 = .;
whisp91 = .;
if (v20048 ge 1 and v20048 le 7) then whisp91 = 1;
if (v20049 = 5 or v20050 = 5) then whisp91 = 1;
if (v20049 = 2 or v20050 = 2) then wblack91 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp91 = 1 then wblack91 = 0;
if wblack91 = 1 then whisp91 = 0;
if (whisp91 = .) then do;
   if (v20049 = 1 or v20049 = 3 or v20049 = 4 or v20049 = 7 or v20049 = 6
    or v20050 = 1 or v20050 = 3 or v20050 = 4 or v20050 = 7 or v20050 = 6) then whisp91 = 0; 
end;
if (wblack91 = .) then do;
   if (v20049 = 1 or v20049 = 3 or v20049 = 4 or v20049 = 7 or v20049 = 6
    or v20050 = 1 or v20050 = 3 or v20050 = 4 or v20050 = 7 or v20050 = 6) then wblack91 = 0; 
end;

regne91 = .;
if V20189 = 1 then regne91 = 1;
regnc91 = .;
if V20189 = 2 then regnc91 = 1;
regs91 = .;
if V20189 = 3 then regs91 = 1;
regw91 = .;
if (V20189 = 4 or v20189 = 5) then regw91 = 1;

**1992;
intnum92 = .;
intnum92 = v20302;

hblack92 = .;
hhisp92 = .;
if (v21419 ge 1 and v21419 le 7) then hhisp92 = 1;
if (v21420 = 5 or v21421 = 5) then hhisp92 = 1;
if (v21420 = 2 or v21421 = 2) then hblack92 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp92 = 1 then hblack92 = 0;
if hblack92 = 1 then hhisp92 = 0;
if (hhisp92 = .) then do;
   if (v21420 = 1 or v21420 = 3 or v21420 = 4 or v21420 = 7 or v21420 = 6
    or v21421 = 1 or v21421 = 3 or v21421 = 4 or v21421 = 7 or v21421 = 6) then hhisp92 = 0; 
end;
if (hblack92 = .) then do;
   if (v21420 = 1 or v21420 = 3 or v21420 = 4 or v21420 = 7 or v21420 = 6
    or v21421 = 1 or v21421 = 3 or v21421 = 4 or v21421 = 7 or v21421 = 6) then hblack92 = 0; 
end;

wblack92 = .;
whisp92 = .;
if (v21354 ge 1 and v21354 le 7) then whisp92 = 1;
if (v21355 = 5 or v21356 = 5) then whisp92 = 1;
if (v21355 = 2 or v21356 = 2) then wblack92 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp92 = 1 then wblack92 = 0;
if wblack92 = 1 then whisp92 = 0;
if (whisp92 = .) then do;
   if (v21355 = 1 or v21355 = 3 or v21355 = 4 or v21355 = 7 or v21355 = 6
    or v21356 = 1 or v21356 = 3 or v21356 = 4 or v21356 = 7 or v21356 = 6) then whisp92 = 0; 
end;
if (wblack92 = .) then do;
   if (v21355 = 1 or v21355 = 3 or v21355 = 4 or v21355 = 7 or v21355 = 6
    or v21356 = 1 or v21356 = 3 or v21356 = 4 or v21356 = 7 or v21356 = 6) then wblack92 = 0; 
end;

regne92 = .;
if V21495 = 1 then regne92 = 1;
regnc92 = .;
if V21495 = 2 then regnc92 = 1;
regs92 = .;
if V21495 = 3 then regs92 = 1;
regw92 = .;
if (V21495 = 4 or v21495 = 5) then regw92 = 1;

**1993;
intnum93 = .;
intnum93 = v21602;

hblack93 = .;
hhisp93 = .;
if (v23275 ge 1 and v23275 le 7) then hhisp93 = 1;
if (v23276 = 5 or v23277 = 5) then hhisp93 = 1;
if (v23276 = 2 or v23277 = 2) then hblack93 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp93 = 1 then hblack93 = 0;
if hblack93 = 1 then hhisp93 = 0;
if (hhisp93 = .) then do;
   if (v23276 = 1 or v23276 = 3 or v23276 = 4 or v23276 = 7 or v23276 = 6
    or v23277 = 1 or v23277 = 3 or v23277 = 4 or v23277 = 7 or v23277 = 6) then hhisp93 = 0; 
end;
if (hblack93 = .) then do;
   if (v23276 = 1 or v23276 = 3 or v23276 = 4 or v23276 = 7 or v23276 = 6
    or v23277 = 1 or v23277 = 3 or v23277 = 4 or v23277 = 7 or v23277 = 6) then hblack93 = 0; 
end;

wblack93 = .;
whisp93 = .;
if (v23211 ge 1 and v23211 le 7) then whisp93 = 1;
if (v23212 = 5 or v23213 = 5) then whisp93 = 1;
if (v23212 = 2 or v23213 = 2) then wblack93 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp93 = 1 then wblack93 = 0;
if wblack93 = 1 then whisp93 = 0;
if (whisp93 = .) then do;
   if (v23212 = 1 or v23212 = 3 or v23212 = 4 or v23212 = 7 or v23212 = 6
    or v23213 = 1 or v23213 = 3 or v23213 = 4 or v23213 = 7 or v23213 = 6) then whisp93 = 0; 
end;
if (wblack93 = .) then do;
   if (v23212 = 1 or v23212 = 3 or v23212 = 4 or v23212 = 7 or v23212 = 6
    or v23213 = 1 or v23213 = 3 or v23213 = 4 or v23213 = 7 or v23213 = 6) then wblack93 = 0; 
end;

regne93 = .;
if V23327 = 1 then regne93 = 1;
regnc93 = .;
if V23327 = 2 then regnc93 = 1;
regs93 = .;
if V23327 = 3 then regs93 = 1;
regw93 = .;
if (V23327 = 4 or v23327 = 5) then regw93 = 1;

**1994;
intnum94 = .;
intnum94 = er2002;

hblack94 = .;
hhisp94 = .;
if (er3941 ge 1 and er3941 le 7) then hhisp94 = 1;
if (er3944 = 5 or er3945 = 5) then hhisp94 = 1;
if (er3944 = 2 or er3945 = 2) then hblack94 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp94 = 1 then hblack94 = 0;
if hblack94 = 1 then hhisp94 = 0;
if (hhisp94 = .) then do;
   if (er3944 = 1 or er3944 = 3 or er3944 = 4 or er3944 = 7 or er3944 = 6
    or er3945 = 1 or er3945 = 3 or er3945 = 4 or er3945 = 7 or er3945 = 6) then hhisp94 = 0; 
end;
if (hblack94 = .) then do;
   if (er3944 = 1 or er3944 = 3 or er3944 = 4 or er3944 = 7 or er3944 = 6
    or er3945 = 1 or er3945 = 3 or er3945 = 4 or er3945 = 7 or er3945 = 6) then hblack94 = 0; 
end;

wblack94 = .;
whisp94 = .;
if (er3880 ge 1 and er3880 le 7) then whisp94 = 1;
if (er3883 = 5 or er3884 = 5) then whisp94 = 1;
if (er3883 = 2 or er3884 = 2) then wblack94 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp94 = 1 then wblack94 = 0;
if wblack94 = 1 then whisp94 = 0;
if (whisp94 = .) then do;
   if (er3883 = 1 or er3883 = 3 or er3883 = 4 or er3883 = 7 or er3883 = 6
    or er3884 = 1 or er3884 = 3 or er3884 = 4 or er3884 = 7 or er3884 = 6) then whisp94 = 0; 
end;
if (wblack94 = .) then do;
   if (er3883 = 1 or er3883 = 3 or er3883 = 4 or er3883 = 7 or er3883 = 6
    or er3884 = 1 or er3884 = 3 or er3884 = 4 or er3884 = 7 or er3884 = 6) then wblack94 = 0; 
end;

regne94 = .;
if (er4157=9 or er4157=23 or er4157=25 or er4157=33 or er4157=34
 or er4157=36 or er4157=42 or er4157=44 or er4157=50) then regne94 = 1;
regnc94 = .;
if (er4157=17 or er4157=18 or er4157=19 or er4157=20 or er4157=26
 or er4157=27 or er4157=29 or er4157=31 or er4157=38 or er4157=39
 or er4157=46 or er4157=55) then regnc94 = 1;
regs94 = .;
if (er4157=1 or er4157=5 or er4157=10 or er4157=11 or er4157=12
 or er4157=13 or er4157=21 or er4157=22 or er4157=24 or er4157=28
 or er4157=37 or er4157=40 or er4157=45 or er4157=47 or er4157=48
 or er4157=51 or er4157=54) then regs94 = 1;
regw94 = .;
if (er4157=2 or er4157=4 or er4157=6 or er4157=8 or er4157=15
 or er4157=16 or er4157=30 or er4157=32 or er4157=35 or er4157=41
 or er4157=49 or er4157=53 or er4157=56) then regw94 = 1;

**1995;
intnum95 = .;
intnum95 = er5002;

hblack95 = .;
hhisp95 = .;
if (er6811 ge 1 and er6811 le 7) then hhisp95 = 1;
if (er6814 = 5 or er6815 = 5) then hhisp95 = 1;
if (er6814 = 2 or er6815 = 2) then hblack95 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp95 = 1 then hblack95 = 0;
if hblack95 = 1 then hhisp95 = 0;
if (hhisp95 = .) then do;
   if (er6814 = 1 or er6814 = 3 or er6814 = 4 or er6814 = 7 or er6814 = 6
    or er6815 = 1 or er6815 = 3 or er6815 = 4 or er6815 = 7 or er6815 = 6) then hhisp95 = 0; 
end;
if (hblack95 = .) then do;
   if (er6814 = 1 or er6814 = 3 or er6814 = 4 or er6814 = 7 or er6814 = 6
    or er6815 = 1 or er6815 = 3 or er6815 = 4 or er6815 = 7 or er6815 = 6) then hblack95 = 0; 
end;

wblack95 = .;
whisp95 = .;
if (er6750 ge 1 and er6750 le 7) then whisp95 = 1;
if (er6753 = 5 or er6754 = 5) then whisp95 = 1;
if (er6753 = 2 or er6754 = 2) then wblack95 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp95 = 1 then wblack95 = 0;
if wblack95 = 1 then whisp95 = 0;
if (whisp95 = .) then do;
   if (er6753 = 1 or er6753 = 3 or er6753 = 4 or er6753 = 7 or er6753 = 6
    or er6754 = 1 or er6754 = 3 or er6754 = 4 or er6754 = 7 or er6754 = 6) then whisp95 = 0; 
end;
if (wblack95 = .) then do;
   if (er6753 = 1 or er6753 = 3 or er6753 = 4 or er6753 = 7 or er6753 = 6
    or er6754 = 1 or er6754 = 3 or er6754 = 4 or er6754 = 7 or er6754 = 6) then wblack95 = 0; 
end;

regne95 = .;
if (er6997=9 or er6997=23 or er6997=25 or er6997=33 or er6997=34
 or er6997=36 or er6997=42 or er6997=44 or er6997=50) then regne95 = 1;
regnc95 = .;
if (er6997=17 or er6997=18 or er6997=19 or er6997=20 or er6997=26
 or er6997=27 or er6997=29 or er6997=31 or er6997=38 or er6997=39
 or er6997=46 or er6997=55) then regnc95 = 1;
regs95 = .;
if (er6997=1 or er6997=5 or er6997=10 or er6997=11 or er6997=12
 or er6997=13 or er6997=21 or er6997=22 or er6997=24 or er6997=28
 or er6997=37 or er6997=40 or er6997=45 or er6997=47 or er6997=48
 or er6997=51 or er6997=54) then regs95 = 1;
regw95 = .;
if (er6997=2 or er6997=4 or er6997=6 or er6997=8 or er6997=15
 or er6997=16 or er6997=30 or er6997=32 or er6997=35 or er6997=41
 or er6997=49 or er6997=53 or er6997=56) then regw95 = 1;

**1996;
intnum96 = .;
intnum96 = er7002;

hblack96 = .;
hhisp96 = .;
if (er9057 ge 1 and er9057 le 7) then hhisp96 = 1;
if (er9060 = 5 or er9061 = 5) then hhisp96 = 1;
if (er9060 = 2 or er9061 = 2) then hblack96 = 1;
*so mutually exclusive, Hispanic takes precedent;
if hhisp96 = 1 then hblack96 = 0;
if hblack96 = 1 then hhisp96 = 0;
if (hhisp96 = .) then do;
   if (er9060 = 1 or er9060 = 3 or er9060 = 4 or er9060 = 7 or er9060 = 6
    or er9061 = 1 or er9061 = 3 or er9061 = 4 or er9061 = 7 or er9061 = 6) then hhisp96 = 0; 
end;
if (hblack96 = .) then do;
   if (er9060 = 1 or er9060 = 3 or er9060 = 4 or er9060 = 7 or er9060 = 6
    or er9061 = 1 or er9061 = 3 or er9061 = 4 or er9061 = 7 or er9061 = 6) then hblack96 = 0; 
end;

wblack96 = .;
whisp96 = .;
if (er8996 ge 1 and er8996 le 7) then whisp96 = 1;
if (er8999 = 5 or er9000 = 5) then whisp96 = 1;
if (er8999 = 2 or er9000 = 2) then wblack96 = 1;
*so mutually exclusive, Hispanic takes precedent;
if whisp96 = 1 then wblack96 = 0;
if wblack96 = 1 then whisp96 = 0;
if (whisp96 = .) then do;
   if (er8999 = 1 or er8999 = 3 or er8999 = 4 or er8999 = 7 or er8999 = 6
    or er9000 = 1 or er9000 = 3 or er9000 = 4 or er9000 = 7 or er9000 = 6) then whisp96 = 0; 
end;
if (wblack96 = .) then do;
   if (er8999 = 1 or er8999 = 3 or er8999 = 4 or er8999 = 7 or er8999 = 6
    or er9000 = 1 or er9000 = 3 or er9000 = 4 or er9000 = 7 or er9000 = 6) then wblack96 = 0; 
end;

regne96 = .;
if (er9248=9 or er9248=23 or er9248=25 or er9248=33 or er9248=34
 or er9248=36 or er9248=42 or er9248=44 or er9248=50) then regne96 = 1;
regnc96 = .;
if (er9248=17 or er9248=18 or er9248=19 or er9248=20 or er9248=26
 or er9248=27 or er9248=29 or er9248=31 or er9248=38 or er9248=39
 or er9248=46 or er9248=55) then regnc96 = 1;
regs96 = .;
if (er9248=1 or er9248=5 or er9248=10 or er9248=11 or er9248=12
 or er9248=13 or er9248=21 or er9248=22 or er9248=24 or er9248=28
 or er9248=37 or er9248=40 or er9248=45 or er9248=47 or er9248=48
 or er9248=51 or er9248=54) then regs96 = 1;
regw96 = .;
if (er9248=2 or er9248=4 or er9248=6 or er9248=8 or er9248=15
 or er9248=16 or er9248=30 or er9248=32 or er9248=35 or er9248=41
 or er9248=49 or er9248=53 or er9248=56) then regw96 = 1;

**1997;
intnum97 = .;
intnum97 = er10002;

**note, looks like they skipped asking the main latino question, just melded in;
**can't define it like before;

regne97 = .;
if (er10004=9 or er10004=23 or er10004=25 or er10004=33 or er10004=34
 or er10004=36 or er10004=42 or er10004=44 or er10004=50) then regne97 = 1;
regnc97 = .;
if (er10004=17 or er10004=18 or er10004=19 or er10004=20 or er10004=26
 or er10004=27 or er10004=29 or er10004=31 or er10004=38 or er10004=39
 or er10004=46 or er10004=55) then regnc97 = 1;
regs97 = .;
if (er10004=1 or er10004=5 or er10004=10 or er10004=11 or er10004=12
 or er10004=13 or er10004=21 or er10004=22 or er10004=24 or er10004=28
 or er10004=37 or er10004=40 or er10004=45 or er10004=47 or er10004=48
 or er10004=51 or er10004=54) then regs97 = 1;
regw97 = .;
if (er10004=2 or er10004=4 or er10004=6 or er10004=8 or er10004=15
 or er10004=16 or er10004=30 or er10004=32 or er10004=35 or er10004=41
 or er10004=49 or er10004=53 or er10004=56) then regw97 = 1;

faminc97 = .;
if er12079 ne 0 then faminc97 = er12079;

intnum99 = .;
intnum99 = er13002;
intnum01 = .;
intnum01 = er17002;
intnum03 = .;
intnum03 = er21002;
intnum05 = .;
intnum05 = er25002;


**using different program for mother's religion, as didn't pull off enough variables;

proc means;
run ;
